Telegram Group & Telegram Channel
# پاسخ تمرین شماره 2
eq = ""
result = 0
op = "+"
loopsFirstRun = True
while True:
if loopsFirstRun != True:
op = input("Enter an operator (+,-,*,/,=) : ") # دریافت علامت
eq = "(" + eq + op;
if op == "=":
break
num = float(input("Enter a number : ")) # دریافت عدد
if op == "+":
result = result + num
elif op == "-":
result = result - num
elif op == "*":
result = result * num
elif op == "/":
result = result / num
else: # در صورتی که علامت وارد شده از چهار عمل اصلی نباشد
result = "Invalid operator : " + op # نمایش پیغام خطا
eq = eq + str(num);
if loopsFirstRun != True:
eq = eq + ")";
print(eq + " = " + str(result))
loopsFirstRun = False
print(result)



tg-me.com/python12/1306
Create:
Last Update:

# پاسخ تمرین شماره 2
eq = ""
result = 0
op = "+"
loopsFirstRun = True
while True:
if loopsFirstRun != True:
op = input("Enter an operator (+,-,*,/,=) : ") # دریافت علامت
eq = "(" + eq + op;
if op == "=":
break
num = float(input("Enter a number : ")) # دریافت عدد
if op == "+":
result = result + num
elif op == "-":
result = result - num
elif op == "*":
result = result * num
elif op == "/":
result = result / num
else: # در صورتی که علامت وارد شده از چهار عمل اصلی نباشد
result = "Invalid operator : " + op # نمایش پیغام خطا
eq = eq + str(num);
if loopsFirstRun != True:
eq = eq + ")";
print(eq + " = " + str(result))
loopsFirstRun = False
print(result)

BY پایتون / python


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python12/1306

View MORE
Open in Telegram


پایتون python Telegram | DID YOU KNOW?

Date: |

Telegram today rolling out an update which brings with it several new features.The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations.

پایتون python from in


Telegram پایتون / python
FROM USA